package com.lky.reggie.config;

import com.lky.reggie.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author shkstart
 * @Description
 * @date 2023-01-03-15:32
 */
@Deprecated
//@Configuration
public class AdminWebconfig implements WebMvcConfigurer {

    /**
            * 1、编写一个拦截器实现HandLerInterceptor
 * 2、将拦截器注册到容器中（实现WebMvcConfigurer）
            * 3、指定拦截规则【如果所有拦截，静态也会被拦截】
            */

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").
                excludePathPatterns("/employee/login","/employee/logout","/backend/**","/front/**");
    }
}
